<div class="content-section introduction">
    <div class="feature-intro">
        <h1>Dialog</h1>
        <p>Dialog is a container to display content in an overlay window.</p>
    </div>
    <app-demoActions github="dialog" stackblitz="dialog-demo"></app-demoActions>
</div>

<div class="content-section implementation">
    <div class="card">
        <h5>Basic</h5>
        <p-button (click)="showBasicDialog()" icon="pi pi-external-link" label="Show"></p-button>
        <p-dialog header="Header" [(visible)]="displayBasic" [style]="{width: '50vw'}">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
                cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            <ng-template pTemplate="footer">
                <p-button icon="pi pi-check" (click)="displayBasic=false" label="Ok" styleClass="p-button-text"></p-button>
            </ng-template>
        </p-dialog>

        <p-button (click)="showBasicDialog2()" icon="pi pi-external-link" label="Long Content"></p-button>
        <p-dialog header="Long Content" [(visible)]="displayBasic2" [style]="{width: '50vw'}">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
                ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
                culpa qui officia deserunt mollit anim id est laborum.</p>

            <p>"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae
                dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est,
                qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,
                quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur,
                vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>

            <p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident,
                similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio
                cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe
                eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p>
            <ng-template pTemplate="footer">
                <p-button icon="pi pi-check" (click)="displayBasic2=false" label="Ok" styleClass="p-button-text"></p-button>
            </ng-template>
        </p-dialog>

        <h5>Modal</h5>
        <p-button (click)="showModalDialog()" icon="pi pi-external-link" label="Show"></p-button>
        <p-dialog header="Header" [(visible)]="displayModal" [modal]="true" [style]="{width: '50vw'}"
            [draggable]="false" [resizable]="false">
            <p class="m-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
                laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
                Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
               <ng-template pTemplate="footer">
                <p-button icon="pi pi-check" (click)="displayModal=false" label="Ok" styleClass="p-button-text"></p-button>
               </ng-template>
        </p-dialog>

        <h5>Responsive</h5>
        <p-button (click)="showResponsiveDialog()" icon="pi pi-external-link" label="Show"></p-button>
        <p-dialog header="Header" [(visible)]="displayResponsive" [breakpoints]="{'960px': '75vw'}" [style]="{width: '50vw'}" [draggable]="false" [resizable]="false">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
                cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
               <ng-template pTemplate="footer">
                <p-button (click)="displayResponsive=false" label="No" styleClass="p-button-text"></p-button>
                <p-button (click)="displayResponsive=false" label="Yes" styleClass="p-button-text"></p-button>
               </ng-template>
        </p-dialog>

        <h5>Maximizable</h5>
        <p-button (click)="showMaximizableDialog()" icon="pi pi-external-link" label="Show"></p-button>
        <p-dialog header="Godfather I" [(visible)]="displayMaximizable" [modal]="true" [style]="{width: '50vw'}" [maximizable]="true"
            [draggable]="false" [resizable]="false">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
                Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
                cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
               <ng-template pTemplate="footer">
                   <p-button icon="pi pi-check" (click)="displayMaximizable=false" label="Ok" styleClass="p-button-text"></p-button>
               </ng-template>
        </p-dialog>

        <h5>Position</h5>
        <div class="grid flex-column">
            <div class="col mb-2">
                <p-button (click)="showPositionDialog('left')" icon="pi pi-arrow-right" label="Left" styleClass="p-button-warning"></p-button>
                <p-button (click)="showPositionDialog('right')" icon="pi pi-arrow-left" label="Right" styleClass="p-button-warning"></p-button>
            </div>
            <div class="col mb-2">
                <p-button (click)="showPositionDialog('top-left')" icon="pi pi-arrow-down-right" label="TopLeft" styleClass="p-button-warning"></p-button>
                <p-button (click)="showPositionDialog('top')" icon="pi pi-arrow-down" label="Top" styleClass="p-button-warning"></p-button>
                <p-button (click)="showPositionDialog('top-right')" icon="pi pi-arrow-down-left" label="TopRight" styleClass="p-button-warning"></p-button>
            </div>
            <div class="col mb-2">
                <p-button (click)="showPositionDialog('bottom-left')" icon="pi pi-arrow-up-right" label="BottomLeft" styleClass="p-button-warning"></p-button>
                <p-button (click)="showPositionDialog('bottom')" icon="pi pi-arrow-up" label="Bottom" styleClass="p-button-warning"></p-button>
                <p-button (click)="showPositionDialog('bottom-right')" icon="pi pi-arrow-up-left" label="BottomRight" styleClass="p-button-warning"></p-button>
            </div>
        </div>
        <p-dialog header="Godfather I" [(visible)]="displayPosition" [position]="position" [modal]="true" [style]="{width: '50vw'}"
            [draggable]="false" [resizable]="false">
            <p>The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
               His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
               Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
               kind and benevolent to those who give respect,
               but given to ruthless violence whenever anything stands against the good of the family.</p>
               <ng-template pTemplate="footer">
                   <p-button icon="pi pi-check" (click)="displayPosition=false" label="Ok" styleClass="p-button-text"></p-button>
               </ng-template>
        </p-dialog>
    </div>
</div>

<div class="content-section documentation">
    <p-tabView>
        <p-tabPanel header="Documentation">
            <h5>Import</h5>
<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;DialogModule&#125; from 'primeng/dialog';
</app-code>

            <h5>Getting Started</h5>
            <p>Dialog is used as a container and visibility is controlled with visible property.</p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-dialog header="Title" [(visible)]="display"&gt;
    Content
&lt;/p-dialog&gt;

&lt;button type="button" (click)="showDialog()" icon="pi pi-info-circle" label="Show"&gt;&lt;/button&gt;
</app-code>

<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
export class ModelComponent &#123;

    display: boolean = false;

    showDialog() &#123;
        this.display = true;
    &#125;

&#125;
</app-code>

            <p>By default dialog is hidden and enabling the <i>visible</i> property displays the dialog. As visible supports
            two-way binding, hiding the dialog with close button updates the visible state as false.</p>

            <h5>Dimensions</h5>
            <p>Use style property to define the dimensions of the Dialog.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-dialog header="Title" [(visible)]="display" [style]="&#123;width: '50vw'&#125;"&gt;
    Content
&lt;/p-dialog&gt;
</app-code>

            <h5>Responsive</h5>
            <p>Dialog width can be adjusted per screen size with the <i>breakpoints</i> option. In example below, default width is set to 50vw and below 961px, width would be 75vw and finally below 641px width becomes
                100%. The value of <i>breakpoints</i> should be an object literal whose keys are the maximum screen sizes and values are the widths per screen.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-dialog [(visible)]="display" [breakpoints]="&#123;'960px': '75vw', '640px': '100vw'&#125;" [style]="&#123;width: '50vw'&#125;"&gt;
    Content
&lt;/p-dialog&gt;
</app-code>

            <h5>Header and Footer</h5>
            <p>Header and Footers sections can be customized using <i>header</i> and <i>footer</i> templates.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-dialog [(visible)]="display"&gt;
    &lt;ng-template pTemplate="header"&gt;
        Header content here
    &lt;/ng-template&gt;
    Content
    &lt;ng-template pTemplate="footer"&gt;
        //buttons
    &lt;/ng-template&gt;
&lt;/p-dialog&gt;
</app-code>

            <h5>Positioning</h5>
            <p>Dialog location is controlled with the <i>position</i> property whose default value is center. Other valid values are top", "bottom", "left", "right", "top-left", "top-right", "bottom-left" and "bottom-right". You may also call the resetPosition() method of Dialog to re-position it after the content or position changes.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-dialog position="top" [(visible)]="display"&gt;
Content
&lt;/p-dialog&gt;
</app-code>

            <h5>Overlays Inside</h5>
            <p>When dialog includes other components with overlays such as dropdown, the overlay part cannot exceed dialog boundaries due to overflow. In order to solve this, you can
            either append the overlay to the body or allow overflow in dialog.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-dialog&gt;
    &lt;p-dropdown appendTo="body"&gt;&lt;/p-dropdown&gt;
&lt;/p-dialog&gt;
</app-code>

            <h5>Initial Focus</h5>
            <p>Adding <i>autofocus</i> to an element applies focus when the dialog is shown.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-dialog [(visible)]="display"&gt;
    &lt;input type="text" pInputText &gt;
    &lt;input type="text" pInputText &gt;
    &lt;button type="button" pButton autofocus&gt;&lt;/button&gt;
&lt;/p-dialog&gt;
</app-code>

            <h5>Animation Configuration</h5>
            <p>Transition of the Dialog open and hide animations can be customized using the transitionOptions property with a default value as <b>150ms cubic-bezier(0, 0, 0.2, 1)</b>,
                example below disables the animation altogether.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-dialog [(visible)]="display" [transitionOptions]="'0ms'"&gt;&lt;/p-dialog&gt;
</app-code>

            <h5>Properties</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>header</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Title text of the dialog.</td>
                        </tr>
                        <tr>
                            <td>draggable</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Enables dragging to change the position using header.</td>
                        </tr>
                        <tr>
                            <td>keepInViewport</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Keeps dialog in the viewport.</td>
                        </tr>
                        <tr>
                            <td>resizable</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Enables resizing of the content.</td>
                        </tr>
                        <tr>
                            <td>contentStyle</td>
                            <td>object</td>
                            <td>null</td>
                            <td>Style of the content section.</td>
                        </tr>
                        <tr>
                            <td>visible</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Specifies the visibility of the dialog.</td>
                        </tr>
                        <tr>
                            <td>modal</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Defines if background should be blocked when dialog is displayed.</td>
                        </tr>
                        <tr>
                            <td>position</td>
                            <td>string</td>
                            <td>center</td>
                            <td>Position of the dialog, options are "center", "top", "bottom", "left", "right", "top-left", "top-right", "bottom-left" or "bottom-right".</td>
                        </tr>
                        <tr>
                            <td>blockScroll</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Whether background scroll should be blocked when dialog is visible.</td>
                        </tr>
                        <tr>
                            <td>closeOnEscape</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Specifices if pressing escape key should hide the dialog.</td>
                        </tr>
                        <tr>
                            <td>dismissableMask</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Specifices if clicking the modal background should hide the dialog.</td>
                        </tr>
                        <tr>
                            <td>rtl</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>When enabled dialog is displayed in RTL direction.</td>
                        </tr>
                        <tr>
                            <td>closable</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Adds a close icon to the header to hide the dialog.</td>
                        </tr>
                        <tr>
                            <td>appendTo</td>
                            <td>any</td>
                            <td>null</td>
                            <td>Target element to attach the dialog, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name).</td>
                        </tr>
                        <tr>
                            <td>style</td>
                            <td>object</td>
                            <td>null</td>
                            <td>Inline style of the component.</td>
                        </tr>
                        <tr>
                            <td>styleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the component.</td>
                        </tr>
                        <tr>
                            <td>maskStyleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the mask.</td>
                        </tr>
                        <tr>
                            <td>contentStyle</td>
                            <td>object</td>
                            <td>null</td>
                            <td>Inline style of the content.</td>
                        </tr>
                        <tr>
                            <td>contentStyleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the content.</td>
                        </tr>
                        <tr>
                            <td>showHeader</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Whether to show the header or not.</td>
                        </tr>
                        <tr>
                            <td>baseZIndex</td>
                            <td>number</td>
                            <td>0</td>
                            <td>Base zIndex value to use in layering.</td>
                        </tr>
                        <tr>
                            <td>autoZIndex</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Whether to automatically manage layering.</td>
                        </tr>
                        <tr>
                            <td>minX</td>
                            <td>number</td>
                            <td>0</td>
                            <td>Minimum value for the left coordinate of dialog in dragging.</td>
                        </tr>
                        <tr>
                            <td>minY</td>
                            <td>number</td>
                            <td>0</td>
                            <td>Minimum value for the top coordinate of dialog in dragging.</td>
                        </tr>
                        <tr>
                            <td>focusOnShow</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>When enabled, first button receives focus on show.</td>
                        </tr>
                        <tr>
                            <td>focusTrap</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>When enabled, can only focus on elements inside the dialog.</td>
                        </tr>
                        <tr>
                            <td>maximizable</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Whether the dialog can be displayed full screen.</td>
                        </tr>
                        <tr>
                            <td>breakpoints</td>
                            <td>object</td>
                            <td>null</td>
                            <td>Object literal to define widths per screen size.</td>
                        </tr>
                        <tr>
                            <td>transitionOptions</td>
                            <td>string</td>
                            <td>150ms cubic-bezier(0, 0, 0.2, 1)</td>
                            <td>Transition options of the animation.</td>
                        </tr>
                        <tr>
                            <td>closeIcon</td>
                            <td>string</td>
                            <td>pi pi-times</td>
                            <td>Name of the close icon.</td>
                        </tr>
                        <tr>
                            <td>closeAriaLabel</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Defines a string that labels the close button for accessibility.</td>
                        </tr>
                        <tr>
                            <td>closeTabindex</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Index of the close button in tabbing order.</td>
                        </tr>
                        <tr>
                            <td>minimizeIcon</td>
                            <td>string</td>
                            <td>pi pi-window-minimize</td>
                            <td>Name of the minimize icon.</td>
                        </tr>
                        <tr>
                            <td>maximizeIcon</td>
                            <td>string</td>
                            <td>pi pi-window-maximize</td>
                            <td>Name of the maximize icon.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Events</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Parameters</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>onShow</td>
                            <td>event: Event object</td>
                            <td>Callback to invoke when dialog is shown.</td>
                        </tr>
                        <tr>
                            <td>onHide</td>
                            <td>event: Event object</td>
                            <td>Callback to invoke when dialog is hidden.</td>
                        </tr>
                        <tr>
                            <td>onResizeInit</td>
                            <td>event: Event object</td>
                            <td>Callback to invoke when dialog resizing is initiated.</td>
                        </tr>
                        <tr>
                            <td>onResizeEnd</td>
                            <td>event: Event object</td>
                            <td>Callback to invoke when dialog resizing is completed.</td>
                        </tr>
                        <tr>
                            <td>onDragEnd</td>
                            <td>event: Event object</td>
                            <td>Callback to invoke when dialog dragging is completed.</td>
                        </tr>
                        <tr>
                            <td>onMaximize</td>
                            <td>event: Event object</td>
                            <td>Callback to invoke when dialog maximized or unmaximized.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Templates</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Parameters</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>header</td>
                            <td>-</td>
                        </tr>
                        <tr>
                            <td>content</td>
                            <td>-</td>
                        </tr>
                        <tr>
                            <td>footer</td>
                            <td>-</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Styling</h5>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Element</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>p-dialog</td>
                            <td>Container element</td>
                        </tr>
                        <tr>
                            <td>p-dialog-titlebar</td>
                            <td>Container of header.</td>
                        </tr>
                        <tr>
                            <td>p-dialog-title</td>
                            <td>Header element.</td>
                        </tr>
                        <tr>
                            <td>p-dialog-titlebar-icon</td>
                            <td>Icon container inside header.</td>
                        </tr>
                        <tr>
                            <td>p-dialog-titlebar-close</td>
                            <td>Close icon element.</td>
                        </tr>
                        <tr>
                            <td>p-dialog-content</td>
                            <td>Content element.</td>
                        </tr>
                        <tr>
                            <td>p-dialog-footer</td>
                            <td>Footer element.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Dependencies</h5>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/dialog" class="btn-viewsource" target="_blank">
                <span>View on GitHub</span>
            </a>
            <a href="https://stackblitz.com/edit/primeng-dialog-demo" class="btn-viewsource" style="margin-left: .5em;" target="_blank">
                <span>Edit in StackBlitz</span>
            </a>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;h5&gt;Basic&lt;/h5&gt;
&lt;p-button (click)="showBasicDialog()" icon="pi pi-external-link" label="Show"&gt;&lt;/p-button&gt;
&lt;p-dialog header="Header" [(visible)]="displayBasic" [style]="&#123;width: '50vw'&#125;"&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
        cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
    &lt;ng-template pTemplate="footer"&gt;
        &lt;p-button icon="pi pi-check" (click)="displayBasic=false" label="Ok" styleClass="p-button-text"&gt;&lt;/p-button&gt;
    &lt;/ng-template&gt;
&lt;/p-dialog&gt;

&lt;p-button (click)="showBasicDialog2()" icon="pi pi-external-link" label="Long Content"&gt;&lt;/p-button&gt;
&lt;p-dialog header="Long Content" [(visible)]="displayBasic2" [style]="&#123;width: '50vw'&#125;"&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
        ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
        culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;

    &lt;p&gt;"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae
        dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est,
        qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,
        quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur,
        vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?&lt;/p&gt;

    &lt;p&gt;At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident,
        similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio
        cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe
        eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.&lt;/p&gt;
    &lt;ng-template pTemplate="footer"&gt;
        &lt;p-button icon="pi pi-check" (click)="displayBasic2=false" label="Ok" styleClass="p-button-text"&gt;&lt;/p-button&gt;
    &lt;/ng-template&gt;
&lt;/p-dialog&gt;

&lt;h5&gt;Modal&lt;/h5&gt;
&lt;p-button (click)="showModalDialog()" icon="pi pi-external-link" label="Show"&gt;&lt;/p-button&gt;
&lt;p-dialog header="Header" [(visible)]="displayModal" [modal]="true" [style]="&#123;width: '50vw'&#125;"
    [draggable]="false" [resizable]="false"&gt;
    &lt;p class="m-0"&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
        laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
        Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
        &lt;ng-template pTemplate="footer"&gt;
        &lt;p-button icon="pi pi-check" (click)="displayModal=false" label="Ok" styleClass="p-button-text"&gt;&lt;/p-button&gt;
        &lt;/ng-template&gt;
&lt;/p-dialog&gt;

&lt;h5&gt;Responsive&lt;/h5&gt;
&lt;p-button (click)="showResponsiveDialog()" icon="pi pi-external-link" label="Show"&gt;&lt;/p-button&gt;
&lt;p-dialog header="Header" [(visible)]="displayResponsive" [breakpoints]="&#123;'960px': '75vw'&#125;" [style]="&#123;width: '50vw'&#125;"
    [draggable]="false" [resizable]="false"&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
        cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
        &lt;ng-template pTemplate="footer"&gt;
        &lt;p-button (click)="displayResponsive=false" label="No" styleClass="p-button-text"&gt;&lt;/p-button&gt;
        &lt;p-button (click)="displayResponsive=false" label="Yes" styleClass="p-button-text"&gt;&lt;/p-button&gt;
        &lt;/ng-template&gt;
&lt;/p-dialog&gt;

&lt;h5&gt;Maximizable&lt;/h5&gt;
&lt;p-button (click)="showMaximizableDialog()" icon="pi pi-external-link" label="Show"&gt;&lt;/p-button&gt;
&lt;p-dialog header="Godfather I" [(visible)]="displayMaximizable" [modal]="true" [style]="&#123;width: '50vw'&#125;" [maximizable]="true"
    [draggable]="false" [resizable]="false"&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
        cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
        &lt;ng-template pTemplate="footer"&gt;
            &lt;p-button icon="pi pi-check" (click)="displayMaximizable=false" label="Ok" styleClass="p-button-text"&gt;&lt;/p-button&gt;
        &lt;/ng-template&gt;
&lt;/p-dialog&gt;

&lt;h5&gt;Position&lt;/h5&gt;
&lt;div class="grid flex-column"&gt;
    &lt;div class="col mb-2"&gt;
        &lt;p-button (click)="showPositionDialog('left')" icon="pi pi-arrow-right" label="Left" styleClass="p-button-warning"&gt;&lt;/p-button&gt;
        &lt;p-button (click)="showPositionDialog('right')" icon="pi pi-arrow-left" label="Right" styleClass="p-button-warning"&gt;&lt;/p-button&gt;
    &lt;/div&gt;
    &lt;div class="col mb-2"&gt;
        &lt;p-button (click)="showPositionDialog('top-left')" icon="pi pi-arrow-down" label="TopLeft" styleClass="p-button-warning"&gt;&lt;/p-button&gt;
        &lt;p-button (click)="showPositionDialog('top')" icon="pi pi-arrow-down" label="Top" styleClass="p-button-warning"&gt;&lt;/p-button&gt;
        &lt;p-button (click)="showPositionDialog('top-right')" icon="pi pi-arrow-down" label="TopRight" styleClass="p-button-warning"&gt;&lt;/p-button&gt;
    &lt;/div&gt;
    &lt;div class="col mb-2"&gt;
        &lt;p-button (click)="showPositionDialog('bottom-left')" icon="pi pi-arrow-up" label="BottomLeft" styleClass="p-button-warning"&gt;&lt;/p-button&gt;
        &lt;p-button (click)="showPositionDialog('bottom')" icon="pi pi-arrow-up" label="Bottom" styleClass="p-button-warning"&gt;&lt;/p-button&gt;
        &lt;p-button (click)="showPositionDialog('bottom-right')" icon="pi pi-arrow-up" label="BottomRight" styleClass="p-button-warning"&gt;&lt;/p-button&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;p-dialog header="Godfather I" [(visible)]="displayPosition" [position]="position" [modal]="true" [style]="&#123;width: '50vw'&#125;"
    [draggable]="false" [resizable]="false"&gt;
    &lt;p&gt;The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
        His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
        Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
        kind and benevolent to those who give respect,
        but given to ruthless violence whenever anything stands against the good of the family.&lt;/p&gt;
        &lt;ng-template pTemplate="footer"&gt;
            &lt;p-button icon="pi pi-check" (click)="displayPosition=false" label="Ok" styleClass="p-button-text"&gt;&lt;/p-button&gt;
        &lt;/ng-template&gt;
&lt;/p-dialog&gt;
</app-code>

<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
export class DialogDemo &#123;

    displayModal: boolean;

    displayBasic: boolean;

    displayBasic2: boolean;

    displayMaximizable: boolean;

    displayPosition: boolean;

    position: string;

    showModalDialog() &#123;
        this.displayModal = true;
    &#125;

    showBasicDialog() &#123;
        this.displayBasic = true;
    &#125;

    showBasicDialog2() &#123;
        this.displayBasic2 = true;
    &#125;

    showMaximizableDialog() &#123;
        this.displayMaximizable = true;
    &#125;

    showPositionDialog(position: string) &#123;
        this.position = position;
        this.displayPosition = true;
    &#125;

&#125;
</app-code>

<app-code lang="css" ngNonBindable ngPreserveWhitespaces>
:host ::ng-deep .p-button &#123;
    margin: 0 .5rem 0 0;
    min-width: 10rem;
&#125;

p &#123;
    margin: 0;
&#125;

.confirmation-content &#123;
    display: flex;
    align-items: center;
    justify-content: center;
&#125;

:host ::ng-deep .p-dialog .p-button &#123;
    min-width: 6rem;
&#125;
</app-code>
        </p-tabPanel>
        <p-tabPanel header="StackBlitz">
            <ng-template pTemplate="content">
                <iframe src="https://stackblitz.com/edit/primeng-dialog-demo?embed=1" style="width: 100%; height: 768px; border: none;"></iframe>
            </ng-template>
        </p-tabPanel>
    </p-tabView>
</div>
